what does this function do and what does it mean ?`
NickName:luly Ask DateTime:2016-05-27T04:33:21

what does this function do and what does it mean ?`

I'm trying to understand what each line of this code does e.g. why is the $ there and what does it do?, can anyone help?

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<head> 
<script>
i=1;
$(document).ready(function(){
    $("button").click(function(){

    if(i==1){   
    document.getElementById("tf1").setAttribute("fill", "transparent");
    document.getElementById("tf2") .setAttribute("fill", "yellow");
        i=2;
     }else if (i==2){
    document.getElementById("tf2").setAttribute("fill", "transparent");
    document.getElementById("tf3") .setAttribute("fill", "green");
    i=3;
      } else if(i==3) {
    document.getElementById("tf3").setAttribute("fill", "transparent");
    document.getElementById("tf1").setAttribute("fill", "red") ;
        i=1;
    }       

    });
});

</script>

Copyright Notice:Content Author:「luly」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/37470466/what-does-this-function-do-and-what-does-it-mean

More about “what does this function do and what does it mean ?`” related questions

What does `/*, thisArg*/` mean in the function definition?

I am a newbie in JS, and looking at the polyfill definition of the function map this question came to my mind: what in the world does the function definition mean? What does the comment /*, thisArg*/

Show Detail

What does this function mean?

for the following function: (define (update f x v) (λ ($x) (display $x) (newline) (if (equal? $x x) v (f $x)))) what does $ mean here? where does the $x come from?

Show Detail

What does function() in jQuery mean?

What does function() in jquery mean? Because almost all of jquery function has a function() in it. For example: $(function(){ //Do Stuff here }); or: $.each(element, function(something,

Show Detail

what does this function do and what does it mean ?`

I'm trying to understand what each line of this code does e.g. why is the $ there and what does it do?, can anyone help? &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery....

Show Detail

What does this mean? function()!()

What does this mean? function()!() which came from '%!in%' &lt;- function(x,y)!('%in%'(x,y)) #define not in function https://www.kaggle.com/robhardwick/titanic/my-first-kaggle-script

Show Detail

what does setState: function(){ mean

what does it mean when you set a function like this setState: function(){ }

Show Detail

function(el,ev) what does it mean?

when i have something like this ".mylabel click": function (el,ev){ //mycode in here } what does el mean? what does ev mean? I have tried searching it in canjs, but there isn't enough informat...

Show Detail

What does this Javascript syntax mean?

I am working with ROS structure and facing some problem with debugging, and I found this snippet: ros.visualization.GLNode = Class.extend({ init: function () { this.meshGroupIDs = [ ];...

Show Detail

what does the function! mean in vimscript?

what does the function! mean in vimscript, I learned vimscript from: http://learnvimscriptthehardway.stevelosh.com/chapters/38.html what different between function and function! ?

Show Detail

What does char * mean

So...say I had a function like this... int function( const char *c ) { //do something with the char *c here... } what does char *c mean? I know about chars in general I think but I don't get wh...

Show Detail